package com.superarai.portal.dto;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.seasar.framework.container.annotation.tiger.Component;
import org.seasar.framework.container.annotation.tiger.InstanceType;
import org.seasar.framework.util.StringUtil;

@Component(instance = InstanceType.SESSION)
public class LoginInfoDto implements Serializable {

	private static final long serialVersionUID = -4570912303836508078L;
	
	public String userId;
	
	private String loginErrorURI;
	private Map<String, List<String>> parameterMap;
	
	public boolean isLogin() {
		if(StringUtil.isEmpty(userId)) {
			return false;
		}
		return true;
	}
	
	public void logout() {
		userId = null;
		loginErrorURI = null;
		parameterMap = null;
	}
	
	public void loginSuccess() {
		loginErrorURI = null;
	}

	public String getLoginErrorURI() {
		return loginErrorURI;
	}

	public void setLoginErrorURI(String loginErrorURI) {
		this.loginErrorURI = loginErrorURI;
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public void setLoginErrorParameters(Map parameterMap) {
		this.parameterMap = parameterMap;
	}

	public Map<String, List<String>> getLoginErrorParameters() {
		return parameterMap;
	}
}
